package com.dingwen.treasure.core.service;


import com.dingwen.treasure.base.exception.CaptchaException;
import com.dingwen.treasure.model.vo.CaptchaVo;

/**
 * 　CodeService : 验证码
 * 　@author dingwen
 * 　@since  2022/6/11
 */
public interface CaptchaService {

    /**
     * 验证验证码是否正确
     *
     * @param code       验证码
     * @param serverCode 服务器端验证码
     * @throws CaptchaException 验证码异常
     */
    void validate(String code, String serverCode) throws CaptchaException;


    /**
     * 生成数字验证码
     *
     * @return {@link Integer}
     */
    CaptchaVo generateNumberCaptcha();


    /**
     * 生成图像验证码
     *
     * @return {@link CaptchaVo}
     * @throws Exception 异常
     */
    CaptchaVo generateImageCaptcha();
}
